<template>
	<div>
		<el-row v-if="!detailShow">
			<el-col :span="24">
				<div style="height: 0.5em;"></div>
			</el-col>
			<el-col :span="1" class="labelCol">
				<p class="labelText">选择月份:</p>
			</el-col>
			<el-col :span="4">
				<el-date-picker size="small" v-model="time" format="yyyy-MM" :editable=false type="month" placeholder="选择月份">
				</el-date-picker>
			</el-col>
			<el-col :span="10" :offset="1" >
				<el-button type="primary" size="small" v-on:click='baseQuery'>查询</el-button>
				<el-button type="primary" size="small" v-on:click="processOut" v-if="table">导出</el-button>
				<el-button type="primary" size="small" v-on:click='lookReport'>报表说明</el-button>
				<el-button class="el-icon-menu" type="primary" size="small" v-on:click='change'></el-button>
			</el-col>
			<el-col :span="24">
				<div style="height: 1em;"></div>
			</el-col>
		</el-row>

		<div class="report_Fixedwidth" v-if="table&&!detailShow">
			<table class="report_table" id="monthly" cellspacing="0" cellpadding="0" width="1300px">
				<tbody>
					<tr class="texttbody">
						<th scope="col" rowspan="2" colspan="4">公司</th>
						<th scope="col" rowspan="2" colspan="2" style="width: 45px">客户经理</th>
						<th scope="col" colspan="6">首保</th>
						<th scope="col" colspan="6">二保</th>
						<th scope="col" colspan="6">定保</th>
						<th scope="col" colspan="3">目标月汇总</th>
					</tr>
					<tr class="texttbody">
						<td style="width: 45px">首保任务数</td>
						<td style="width: 45px">首保完成数</td>
						<td style="width: 45px">首保完成率 </td>
						<td style="width: 45px">目标月任务数</td>
						<td style="width: 45px">目标月完成数</td>
						<td style="width: 45px">目标月完成率</td>
						<td style="width: 45px">二保任务数</td>
						<td style="width: 45px">二保完成数</td>
						<td style="width: 45px">二保完成率</td>
						<td style="width: 45px">目标月任务数</td>
						<td style="width: 45px">目标月完成数</td>
						<td style="width: 45px">目标月完成率</td>
						<td style="width: 45px">定保任务数</td>
						<td style="width: 45px">定保完成数</td>
						<td style="width: 45px">定保完成率</td>
						<td style="width: 45px">目标月任务数</td>
						<td style="width: 45px">目标月完成数</td>
						<td style="width: 45px">目标月完成率</td>
						<td style="width: 45px">任务数</td>
						<td style="width: 45px">完成数</td>
						<td style="width: 45px">完成率</td>
					</tr>
					<tr v-for="item in tableData.dataList">
						<td colspan="4">{{item.oName}}</td>
						<td colspan="2">{{item.uName}}</td>
						<td>
							<div v-if="item.sbTask != '0'">
								<el-button type="text" @click="lookdetail(item,'','sb_mbr')">{{item.sbTask}}</el-button>
							</div>
							<div v-if="item.sbTask == '0'">
								{{item.sbTask}}
							</div>
						</td>
						<td>
							<div v-if="item.sbTaskDone != '0'">
								<el-button type="text" @click="lookdetail(item,'1','sb_mbr')">{{item.sbTaskDone}}</el-button>
							</div>
							<div v-if="item.sbTaskDone == '0'">
								{{item.sbTaskDone}}
							</div>
						</td>
						<td>{{item.sbTaskDoneRate=='0.00%'?'0':item.sbTaskDoneRate}}</td>

						<td>
							<div v-if="item.sbyTask != '0'">
								<el-button type="text" @click="lookdetail(item,'','sb_mby')">{{item.sbyTask}}</el-button>
							</div>
							<div v-if="item.sbyTask == '0'">
								{{item.sbyTask}}
							</div>
						</td>
						<td>
							<div v-if="item.sbyTaskDone != '0'">
								<el-button type="text" @click="lookdetail(item,'1','sb_mby')">{{item.sbyTaskDone}}</el-button>
							</div>
							<div v-if="item.sbyTaskDone == '0'">
								{{item.sbyTaskDone}}
							</div>
						</td>
						<td>{{item.sbyTaskDoneRate=='0.00%'?'0':item.sbyTaskDoneRate}}</td>

						<td>
							<div v-if="item.ebTask != '0'">
								<el-button type="text" @click="lookdetail(item,'','eb_mbr')">{{item.ebTask}}</el-button>
							</div>
							<div v-if="item.ebTask == '0'">
								{{item.ebTask}}
							</div>
						</td>
						<td>
							<div v-if="item.ebTaskDone != '0'">
								<el-button type="text" @click="lookdetail(item,'1','eb_mbr')">{{item.ebTaskDone}}</el-button>
							</div>
							<div v-if="item.ebTaskDone == '0'">
								{{item.ebTaskDone}}
							</div>
						</td>
						<td>{{item.ebTaskDoneRate=='0.00%'?'0':item.ebTaskDoneRate}}</td>
						<td>
							<div v-if="item.ebyTask != '0'">
								<el-button type="text" @click="lookdetail(item,'','eb_mby')">{{item.ebyTask}}</el-button>
							</div>
							<div v-if="item.ebyTask == '0'">
								{{item.ebyTask}}
							</div>
						</td>
						<td>
							<div v-if="item.ebyTaskDone != '0'">
								<el-button type="text" @click="lookdetail(item,'1','eb_mby')">{{item.ebyTaskDone}}</el-button>
							</div>
							<div v-if="item.ebyTaskDone == '0'">
								{{item.ebyTaskDone}}
							</div>
						</td>
						<td>{{item.ebyTaskDoneRate=='0.00%'?'0':item.ebyTaskDoneRate}}</td>

						<td>
							<div v-if="item.dbTask != '0'">
								<el-button type="text" @click="lookdetail(item,'','db_mbr')">{{item.dbTask}}</el-button>
							</div>
							<div v-if="item.dbTask == '0'">
								{{item.dbTask}}
							</div>
						</td>
						<td>
							<div v-if="item.dbTaskDone != '0'">
								<el-button type="text" @click="lookdetail(item,'1','db_mbr')">{{item.dbTaskDone}}</el-button>
							</div>
							<div v-if="item.dbTaskDone == '0'">
								{{item.dbTaskDone}}
							</div>
						</td>
						<td>{{item.dbTaskDoneRate=='0.00%'?'0':item.dbTaskDoneRate}}</td>
						<td>
							<div v-if="item.dbyTask != '0'">
								<el-button type="text" @click="lookdetail(item,'','db_mby')">{{item.dbyTask}}</el-button>
							</div>
							<div v-if="item.dbyTask == '0'">
								{{item.dbyTask}}
							</div>
						</td>
						<td>
							<div v-if="item.dbyTaskDone != '0'">
								<el-button type="text" @click="lookdetail(item,'1','db_mby')">{{item.dbyTaskDone}}</el-button>
							</div>
							<div v-if="item.dbyTaskDone == '0'">
								{{item.dbyTaskDone}}
							</div>
						</td>
						<td>{{item.dbyTaskDoneRate=='0.00%'?'0':item.dbyTaskDoneRate}}</td>

						<td>
							<div v-if="item.taskTotal != '0'">
								<el-button type="text" @click="lookdetail(item,'','')">{{item.taskTotal}}</el-button>
							</div>
							<div v-if="item.taskTotal == '0'">
								{{item.taskTotal}}
							</div>
						</td>
						<td>
							<div v-if="item.taskTotalDone != '0'">
								<el-button type="text" @click="lookdetail(item,'1','')">{{item.taskTotalDone}}</el-button>
							</div>
							<div v-if="item.taskTotalDone == '0'">
								{{item.taskTotalDone}}
							</div>
						</td>
						<td>{{item.taskTotalDoneRate}}</td>
					</tr>

				</tbody>
			</table>
		</div>
		<el-row :gutter="24" v-if="detailShow">
			<el-col :span="24" style="text-align: right;">
				<el-button type="primary" size="small" @click="back">返回</el-button>
			</el-col>
		</el-row>
		<el-row :gutter="24" v-if="detailShow">
			<el-table :data="detailData.dataList" border style="width: 100%;align-content: center;">
				<el-table-column label="车主姓名" prop="ownerName" width="100">
				</el-table-column>
				<el-table-column label="车主手机" prop="ownerPhone" width="150">
				</el-table-column>
				<el-table-column label="车主电话" prop="ownerTel" width="150">
				</el-table-column>
				<el-table-column label="品牌" prop="brand" width="100">
				</el-table-column>
				<el-table-column label="车系" prop="series" width="150">
				</el-table-column>
				<el-table-column label="车型" prop="model" width="100">
				</el-table-column>
				<el-table-column label="车主车辆配置" prop="configure" width="200">
				</el-table-column>
				<el-table-column label="是否返厂" prop="isBack" :formatter="isBackCov" width="100">
				</el-table-column>
				<el-table-column label="提醒时间" prop="expectDate" width="140">
				</el-table-column>
				<el-table-column label="完成时间" prop="dealDate" width="140">
				</el-table-column>
				<el-table-column label="状态" prop="status" :formatter="statusCov" width="80">
				</el-table-column>
				<el-table-column label="内容" prop="content" width="300">
				</el-table-column>
			</el-table>
			<el-pagination small @size-change="handleSizeChanges" @current-change="handleCurrentChanges" :current-page="CurentPages" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout=" total,prev, pager, next" :total="detailData.total">
			</el-pagination>
		</el-row>

		<div v-if="!table">
			<div class="report_Fixedwidth">
				<div class="report_card" v-for="item in tableData.dataList">
					<div class="report_kapian">
						{{item.uName}}
						<br> 客户经理
					</div>
					<div class="report_text">
						<span>首保任务数/首保完成数：{{item.sbTask}}/{{item.sbTaskDone}}</span>
						<br>
						<span>首保月任务数/首保月完成数：{{item.sbyTask}}/{{item.sbyTaskDone}}</span>
						<br> 二保任务数/二保完成数：{{item.ebTask}}/{{item.ebTaskDone}}
						<br> 二保月任务数/二保月完成数：{{item.ebyTask}}/{{item.ebyTaskDone}}
						<br> 定保任务数/定保任务数：{{item.dbTask}}/{{item.dbTaskDone}}
						<br> 定保月任务数/定保月完成数：{{item.dbyTask}}/{{item.dbyTaskDone}}
						<br> 总任务数/总完成数：{{item.taskTotal}}/{{item.taskTotalDone}}
						<br>
					</div>
				</div>
			</div>
		</div>
		<el-dialog title="报表说明" v-model="reportShow" size="tiny">
			<div style="overflow-y: scroll;height: 400px;">
				<b style="font-size: 15px;">月度目标任务：</b>&nbsp;&nbsp;<b style="font-size: 12px;">保养任务跟踪</b><br><br>
				<b style="font-size: 15px;">客户经理:</b>&nbsp;&nbsp;<b style="font-size: 12px;">任务处理人员，未分配代表未下发的任务</b><br><br>
				<b style="font-size: 15px;">首保-首保任务数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为首保目标日的当月任务总数</b><br><br>
				<b style="font-size: 15px;">首保-首保完成数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为首保目标日的当月完成的任务总数</b><br><br>
				<b style="font-size: 15px;">首保-首保完成率：</b>&nbsp;&nbsp;<b style="font-size: 12px;">首保完成数/首保任务数，取两位小数</b><br><br>
				<b style="font-size: 15px;">首保-目标月任务数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为首保目标月的当月任务总数</b><br><br>
				<b style="font-size: 15px;">首保-目标月完成数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为首保目标月的当月完成的任务总数</b><br><br>
				<b style="font-size: 15px;">首保-目标月完成率：</b>&nbsp;&nbsp;<b style="font-size: 12px;">首保-目标月完成数/首保-目标月任务数，取两位小数</b><br><br>
				<b style="font-size: 15px;">二保-二保任务数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为二保目标日的当月任务总数</b><br><br>
				<b style="font-size: 15px;">二保-二保完成数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为二保目标日的当月完成的任务总数</b><br><br>
				<b style="font-size: 15px;">二保-二保完成率：</b>&nbsp;&nbsp;<b style="font-size: 12px;">二保完成数/二保任务数，取两位小数</b><br><br>
				<b style="font-size: 15px;">二保-二标月任务数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为二保目标月的当月任务总数</b><br><br>
				<b style="font-size: 15px;">二保-二标月完成数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为二保目标月的当月完成的任务总数</b><br><br>
				<b style="font-size: 15px;">二保-二标月完成率：</b>&nbsp;&nbsp;<b style="font-size: 12px;">二保-目标月完成数/二保-目标月任务数，取两位小数</b><br><br>
				<b style="font-size: 15px;">定保-定保任务数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为定保目标日的当月任务总数</b><br><br>
				<b style="font-size: 15px;">定保-定保完成数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为定保目标日的当月完成的任务总数</b><br><br>
				<b style="font-size: 15px;">定保-定保完成率：</b>&nbsp;&nbsp;<b style="font-size: 12px;">定保完成数/定保任务数，取两位小数</b><br><br>
				<b style="font-size: 15px;">定保-定标月任务数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为定保目标月的当月任务总数</b><br><br>
				<b style="font-size: 15px;">定保-定标月完成数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">该人员名下的任务小类为定保目标月的当月完成的任务总数</b><br><br>
				<b style="font-size: 15px;">定保-定标月完成率：</b>&nbsp;&nbsp;<b style="font-size: 12px;">定保-目标月完成数/定保-目标月任务数，取两位小数</b><br><br>
				<b style="font-size: 15px;">目标月汇总-任务数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">首保-目标月任务数+二保-目标月任务数+定保目标月任务数</b><br><br>
				<b style="font-size: 15px;">目标月汇总-完成数：</b>&nbsp;&nbsp;<b style="font-size: 12px;">首保-目标月完成任务数+二保-目标月完成任务数+定保目标月完成任务数</b><br><br>
				<b style="font-size: 15px;">目标月汇总-完成率：</b>&nbsp;&nbsp;<b style="font-size: 12px;">目标月汇总-完成数/目标月汇总-任务数,取两位小数</b><br><br>
			</div>
		</el-dialog>
		<exports :tableId="tableId" :excelName="excelName" :template="template" v-on:backFunction="backFunction"></exports>
	</div>
</template>
<script>
	import exports from '../../plugins/exportModule.vue'
	import echarts from 'echarts'
	export default {
		data: function() {
			return {
				//查询条件
				area: '',
				brand: '',
				companyId: window.localStorage.getItem("companyId"),
				areaCombo: [],
				brandCombo: [],
				companyCombo: [],
				reportShow: false,
				table: true,
				msg: "123 ",
				//页码数
				CurentPage: 1,
				//每页的数量
				page: this.page,
				//分组数据
				tableData: {
					total: 0,
					dataList: []
				},
				time: '',
				//表格id
				tableId: '',
				//表格路径
				template: '',
				//表格名字
				excelName: '月度目标任务.xls',
				CurentPages: 1,
				//Mingxi
				detailShow: false,
				detailQueryData: {
					saId: '',
					typeCode: '',
					mDate: '',
					status: '',
					companyId: window.localStorage.getItem("companyId"),
				},
				detailData: {
					total: 0,
					dataList: []
				},
			}
		},
		methods: {
			handleSizeChanges: function() {

			},
			//baoxiandan fenye
			handleCurrentChanges: function(currentPage) {
				this.$data.CurentPages = currentPage;
				this.detatilQuery();
			},
			//fenyechaxun 
			detatilQuery: function() {
				this.$http({
					method: 'POST',
					url: this.API_ROOT + '/crm/kpi/MonthBackTask/detail', //url
					params: { //发送的参数
						companyId: this.$data.detailQueryData.companyId,
						saId: this.$data.detailQueryData.saId,
						mDate: this.$data.detailQueryData.mDate,
						status: this.$data.detailQueryData.status,
						typeCode: this.$data.detailQueryData.typeCode,
						limit: this.page.pageSize,
						start: this.$data.CurentPages
					}
				}).then(function(resp) {
					debugger;
					resp.data.total = parseInt(resp.data.total);
					this.$data.detailData = resp.data;
				}, function(error) {
					// error
				})
			},
			//返回
			back: function() {
				this.$data.detailShow = false;
				this.$data.CurentPages = 1;
				this.$data.detailData.dataList = [];
				this.$data.detailData.total = 0;
			},
			//查看明细
			lookdetail: function(item, num, type) {

				this.$data.detailShow = true;
				if(item.uName == "未分配") {
					this.$data.detailQueryData.saId = "未分配";
				} else {
					this.$data.detailQueryData.saId = item.saId;
				}
				if(this.$data.time == '') {
					var tiems = new Date();
					tiems = this.moment(tiems).format("YYYY-MM")
				} else {
					var tiems = this.moment(this.$data.time).format("YYYY-MM")
				}
				this.$data.detailQueryData.mDate = tiems;
				this.$data.detailQueryData.typeCode = type;
				this.$data.detailQueryData.companyId = item.companyId;
				if(num == '0') {
					this.$data.detailQueryData.status = "";
				} else {
					this.$data.detailQueryData.status = num;
				}

				this.$http({
					method: 'POST',
					url: this.API_ROOT + '/crm/kpi/MonthBackTask/detail', //url
					params: { //发送的参数
						companyId: this.$data.detailQueryData.companyId,
						saId: this.$data.detailQueryData.saId,
						mDate: this.$data.detailQueryData.mDate,
						status: this.$data.detailQueryData.status,
						typeCode: this.$data.detailQueryData.typeCode,
						limit: this.page.pageSize,
						start: this.$data.CurentPages
					}
				}).then(function(resp) {
					debugger;
					resp.data.total = parseInt(resp.data.total);
					this.$data.detailData = resp.data;
				}, function(error) {
					// error
				})

			},
			statusCov: function(row, column) {
				if(row.status == 0) {
					return '未完成';
				} else if(row.status == 1) {
					return '完成';
				} else if(row.status == 2) {
					return '关闭';
				}
			},
			isBackCov: function(row, column) {
				if(row.isBack == 0) {
					return '否';
				}
				if(row.isBack == 1) {
					return '是'
				}
			},
			//daochu 
			processOut: function() {
				this.$data.tableId = "monthly";
				this.$data.template = "<template><div><div><table border='1'>{table}</table></div></div></template>";
			},
			//daochu fanhuihanshu
			backFunction: function() {
				this.$data.tableId = "";
			},
			//查看报表说明
			lookReport: function() {
				this.$data.reportShow = true;
			},
			//表格转换
			change: function() {
				if(this.$data.table == true) {
					this.$data.table = false;
				} else {
					this.$data.table = true;
				}
			},
			//查询
			baseQuery: function() {
				debugger;
				var dates;
				if(this.$data.time == '') {
					dates = this.$data.time;
				} else {
					dates = this.moment(this.$data.time).format("YYYY-MM");
				}
				if(this.$data.companyId == '') {
					this.$message.error("请选择公司")
				} else {
					this.$http.post(this.API_ROOT + '/crm/kpi/MonthBackTask', this.$data.condition, {
							params: {
								start: this.$data.CurentPage,
								companyId: this.$data.companyId,
								area: this.$data.area,
								brand: this.$data.brand,
								limit: 50,
								mDate: dates,
							}
						})
						.then(resp => {
							if(resp.data.success) {
								resp.data.total = parseInt(resp.data.total);
								// es5写法
								this.$data.tableData = resp.data;
								//this.baseQuery(this.$data.curTreeDeptId);
								//this.$data.exFormShow = false;
								//合计
								var sbTask = 0;
								var sbTaskDone = 0;
								var sbyTask = 0;
								var sbyTaskDone = 0;
								var ebTask = 0;
								var ebTaskDone = 0;
								var ebyTask = 0;
								var ebyTaskDone = 0;
								var dbTask = 0;
								var dbTaskDone = 0;
								var dbyTask = 0;
								var dbyTaskDone = 0;
								var taskTotal = 0;
								var taskTotalDone = 0;
								if(this.$data.tableData.dataList.length > 0) {
									for(var i = 0; i < this.$data.tableData.dataList.length; i++) {
										sbTask += Number(this.$data.tableData.dataList[i].sbTask);
										sbTaskDone += Number(this.$data.tableData.dataList[i].sbTaskDone);
										sbyTask += Number(this.$data.tableData.dataList[i].sbyTask);
										sbyTaskDone += Number(this.$data.tableData.dataList[i].sbyTaskDone);
										ebTask += Number(this.$data.tableData.dataList[i].ebTask);
										ebTaskDone += Number(this.$data.tableData.dataList[i].ebTaskDone);
										ebyTask += Number(this.$data.tableData.dataList[i].ebyTask);
										ebyTaskDone += Number(this.$data.tableData.dataList[i].ebyTaskDone);
										dbTask += Number(this.$data.tableData.dataList[i].dbTask);
										dbTaskDone += Number(this.$data.tableData.dataList[i].dbTaskDone);
										dbyTask += Number(this.$data.tableData.dataList[i].dbyTask);
										dbyTaskDone += Number(this.$data.tableData.dataList[i].dbyTaskDone);
										taskTotal += Number(this.$data.tableData.dataList[i].taskTotal);
										taskTotalDone += Number(this.$data.tableData.dataList[i].taskTotalDone);
									}
									debugger;
									//将合计值赋给dataList最后一行
									var length = this.$data.tableData.dataList.length;
									var addArray = {
										uName: '',
										sbTask: ' ',
										sbTaskDone: ' ',
										sbTaskDoneRate: ' ',
										sbyTask: ' ',
										sbyTaskDone: ' ',
										sbyTaskDoneRate: ' ',
										ebTask: ' ',
										ebTaskDone: ' ',
										ebTaskDoneRate: ' ',
										ebyTask: ' ',
										ebyTaskDone: ' ',
										ebyTaskDoneRate: ' ',
										dbTask: ' ',
										dbTaskDone: ' ',
										dbTaskDoneRate: ' ',
										dbyTask: ' ',
										dbyTaskDone: ' ',
										dbyTaskDoneRate: ' ',
										taskTotal: ' ',
										taskTotalDone: ' ',
										taskTotalDoneRate: ' ',
										oName:'',
										companyId:'',
									};
									this.$data.tableData.dataList = this.$data.tableData.dataList.concat(addArray);
									this.$data.tableData.dataList[length].oName = this.$data.tableData.dataList[length-1].oName;
									this.$data.tableData.dataList[length].companyId = this.$data.tableData.dataList[length-1].companyId;
									this.$data.tableData.dataList[length].uName = '合计';
									this.$data.tableData.dataList[length].sbTask = sbTask;
									this.$data.tableData.dataList[length].sbTaskDone = sbTaskDone;
									if(sbTask == '0') {
										this.$data.tableData.dataList[length].sbTaskDoneRate = 0;
									} else {
										this.$data.tableData.dataList[length].sbTaskDoneRate = Number(sbTaskDone*100 / sbTask).toFixed(2) + "%";
									}

									this.$data.tableData.dataList[length].sbyTask = sbyTask;
									this.$data.tableData.dataList[length].sbyTaskDone = sbyTaskDone;
									if(sbyTask == '0') {
										this.$data.tableData.dataList[length].sbyTaskDoneRate = 0;
									} else {
										this.$data.tableData.dataList[length].sbyTaskDoneRate = Number(sbyTaskDone*100 / sbyTask).toFixed(2) + "%";
									}

									this.$data.tableData.dataList[length].ebTask = ebTask;
									this.$data.tableData.dataList[length].ebTaskDone = ebTaskDone;
									if(ebTask == '0') {
										this.$data.tableData.dataList[length].ebTaskDoneRate = 0;
									} else {
										this.$data.tableData.dataList[length].ebTaskDoneRate = Number(ebTaskDone*100 / ebTask).toFixed(2) + "%";
									}
									this.$data.tableData.dataList[length].ebyTask = ebyTask;
									this.$data.tableData.dataList[length].ebyTaskDone = ebyTaskDone;
									if(ebyTask == '0') {
										this.$data.tableData.dataList[length].ebyTaskDoneRate = 0;
									} else {
										this.$data.tableData.dataList[length].ebyTaskDoneRate = Number(ebyTaskDone*100 / ebyTask).toFixed(2) + "%";
									}
									this.$data.tableData.dataList[length].dbTask = dbTask;
									this.$data.tableData.dataList[length].dbTaskDone = dbTaskDone;
									if(dbTask == '0') {
										this.$data.tableData.dataList[length].dbTaskDoneRate = 0;
									} else {
										this.$data.tableData.dataList[length].dbTaskDoneRate = Number(dbTaskDone*100 / dbTask).toFixed(2) + "%";
									}
									this.$data.tableData.dataList[length].dbyTask = dbyTask;
									this.$data.tableData.dataList[length].dbyTaskDone = dbyTaskDone;
									if(dbyTask == '0') {
										this.$data.tableData.dataList[length].dbyTaskDoneRate = 0;
									} else {
										this.$data.tableData.dataList[length].dbyTaskDoneRate = Number(dbyTaskDone*100 / dbyTask).toFixed(2) + "%";
									}
									this.$data.tableData.dataList[length].taskTotal = taskTotal;
									this.$data.tableData.dataList[length].taskTotalDone = taskTotalDone;
									if(taskTotal == '0') {
										this.$data.tableData.dataList[length].taskTotalDoneRate = 0;
									} else {
										this.$data.tableData.dataList[length].taskTotalDoneRate = Number(taskTotalDone*100 / taskTotal).toFixed(2) + "%";
									}
								}
							} else {
								//debugger;
								this.$message.error(resp.data.msg);
							}
						}, resp => {});
				}
			},

			//时间转换
			buyDates: function(row, column) {
				if(row.recordLength == " " || row.recordLength == null) return " ";
				return moment(Number(row.recordLength)).format("YYYY-MM-DD ");
			},
			//获取公司信息
	
		},
		//表单创建时执行
		created: function() {

		},
		components: {
			exports
		}
	}
</script>